﻿using System;
using System.Text;

namespace YK.Component.Data
{
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;
    using YK.Component.Tools;

    public class NHEntityMappingBase<TEntity> : ClassMapping<TEntity> where TEntity : EntityBase
    {
        public NHEntityMappingBase()
        { 
        
        }
        public NHEntityMappingBase(string tableName, string pkColName)
        {
            Table(tableName);
            var entity=default(TEntity);

            Id(m => entity.Id, map =>
            {
                map.Column(pkColName);
                map.Generator(Generators.Assigned);
                //map.Generator(Generators.Sequence, gmap => gmap.Params(new { max_low = 100, sequence = "HI_VALUE_SEQ" }));
            });

            // Version(x => x.Version, map => { });
        }
    }
}
